﻿// See https://aka.ms/new-console-template for more informations

using quartz.net简单封装;

await TimeWork.StartTimeWork(DateTimeOffset.Now.AddSeconds(5), new ActionJob(() =>
{
    Console.WriteLine("五秒后执行");
}));

await TimeWork.CreatePollJob(DateTime.Now, TimeSpan.FromSeconds(3), new ActionJob(() =>
{
    Console.WriteLine("每隔三秒输出一个3");
}));

await TimeWork.CreatePollJob(DateTime.Now, TimeSpan.FromSeconds(5), new ActionJob(() =>
{
    Console.WriteLine("每隔三秒输出一个5");
}));

var result = await TimeWork.GetCurrentExecuteJob();
foreach (var job in result)
{
    Console.WriteLine(job.Key);
}

Console.ReadKey();